Fix usage of cons cells in grep-find-ignored-files
authorSpencer Baugh <sbaugh@janestreet.com>
Wed, 22 May 2024 12:28:07 +0000 (08:28 -0400)
committerDmitry Gutov <dmitry@gutov.dev>
Fri, 24 May 2024 20:04:32 +0000 (23:04 +0300)
commitc812c935486010bfe2f80c3887c708fbaa4907a6
treeb65414051d62d5ee76edd70ac110f80fad3fd21d
parent59d7730a46a4a51a2c7e3c800a1d60f92a2322b6
Fix usage of cons cells in grep-find-ignored-files

grep-find-ignored-files is documented to also include cons
cells, not just globs, but there were two places outside grep.el
where we were using it as if it was only a string list.

To fix this, add a helper function named grep-find-ignored-files
which handles grep-find-ignored-files properly and returns the
list of globs, and use it everywhere.

* lisp/progmodes/grep.el (grep--filter-list-by-dir)
(grep-find-ignored-files): New functions.
(rgrep-find-ignored-directories): Use grep--filter-list-by-dir.
(lgrep, rgrep-default-command):
Use grep-find-ignored-files function.
* lisp/dired-aux.el (dired-do-find-regexp):
Use grep-find-ignored-files function.
* lisp/progmodes/project.el (project-ignores):
Use grep-find-ignored-files function, if bound. (bug#71115)
lisp/dired-aux.el
lisp/progmodes/grep.el
lisp/progmodes/project.el